String
Here are the constructors of the FileOutputStream
Class:
Constructors
FileOutputStream(String name) throws FileNotFoundException — Creates an output stream that writes to the file. FileOutputStream(String name, boolean append) throws FileNotFoundException — Creates an output stream. — If append is true append bytes to the end of the file.
We will always use FileOutputStream
to open a file,
but will use the methods of DataOutputStream
for sending data into the stream.
Will the following statement work?
DataOutputStream dataOut = new DataOutputStream( "myFile.dat" );